package com.interview.ujiuye2;

import java.util.Comparator;
import java.util.TreeSet;

/**
 * Copyright (C), 2018-2020
 * FileName: Demo1
 * Author:   kongfanyu
 * Date:     2020/10/10 20:12
 */
public class Demo1 {

    public static void main(String[] args) {
        Comparator<Integer> comparator  =new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1.compareTo(o2);
            }
        };

        TreeSet<Integer> set = new TreeSet<>(comparator);


        Comparator<Integer> comparator2 = (x,y) -> x.compareTo(y);
        TreeSet<Integer> set2 = new TreeSet<>(comparator2);


    }


}
